const tuple = ['tesla', 'model 3', 'model X', 'model Y'] as const

type result = TupleToObject<typeof tuple> // expected { tesla: 'tesla', 'model 3': 'model 3', 'model X': 'model X', 'model Y': 'model Y'}

type TupleToObject<T extends readonly any[]> = {
  [K in T[number]]: K
}

type Arr = ['1', '2', '3']

type Test = TupleToUnion<Arr> // expected to be '1' | '2' | '3'

// type TupleToUnion<T extends any[]> = T[number]

// type TupleToUnion<T extends any[]> = { [K in T[number]]: T[number] } extends {
//   [K in T[number]]: infer G
// } ? G : never 